<template>
  <div>
    <el-button type="primary" size="default" @click="isDrawerShow = true"
      >分配账号</el-button
    >
    <div v-for="(item, index) in account.userList" :key="index">
      {{ item.username }}
    </div>

    <el-drawer
      title="分配账号"
      v-model="isDrawerShow"
      direction="rtl"
      size="30%"
      :show-close="true"
    >
      <RegForm />
    </el-drawer>
  </div>
</template>

<script setup>
import { ref } from "vue";
import RegForm from "./components/reg-form.vue";
import { useAccount } from "../../store/user";
const isDrawerShow = ref(false);
const account = useAccount();
account.initUserList(); //触发状态机的方法，让它帮我们拿数据
</script>

<style lang="scss" scoped></style>
